"""
给飞鸽传书发送消息
"""
from socket import *

# ip = "10.0.151.228"
ip = "192.168.0.63"
# ip = "127.0.0.1"
port = 2425  # 飞鸽传书端口
address = (ip, port)
udp_send_socket = socket(AF_INET, SOCK_DGRAM)

"""
飞鸽接收数据的格式：
# 版本:包编号:发送者名字:发送主机:命令编号:附加信息
# 1:123:李晶晶:sss:32:美女你好,交个朋友怎么样
"""

# data = "5.1:100:菁菁菁:演示ffff:别慌是我!"
data1 = "5.1:10:李晶晶:QH-20160704TKYL:32:美女你好,交个朋友怎么样ddddd"

# udp_send_socket.sendto(data.encode("gbk"), address)

udp_send_socket.sendto(data1.encode("gbk"), address)
udp_send_socket.close()
